package cn.xyinping.hrm.config;

import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author 27266
 * @desrciption MyBatis-Plus配置类
 * @date 2021/11/20
 */
// spring boot方式
@Configuration
// mapper接口扫描  这儿写了启动类就不用写了
@MapperScan("cn.xyinping.hrm.mapper")
// 事务管理
@EnableTransactionManagement
public class MybatisPlusConfig {
    /**
     * 分页插件 mybatis拦截器实现的分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}
